<template>
    <div class="app_buyrecord_panel">
        <div class="app_buyrecord_tab">
            <div class="title" style="width: 30%;">用户名</div>
            <div class="title" style="width: 30%;">手机号码</div>
            <div class="title" style="width: 40%;">注册时间</div>
        </div>
        <div class="app_buyrecord_tab" v-for="item,index in inviteList" :key="index">
            <div class="word" style="width: 35%;text-align: center;">{{item.username}}</div>
            <div class="word" style="width: 25%;text-align: center;">{{item.mobile}}</div>
            <div class="word" style="width: 40%;">{{item.createTime}}</div>
        </div>
        <ul class="mui-table-view" v-show="noRecord">
            <div class="cmw_noinvest" >
                暂无记录!
            </div>
        </ul>
    </div>
</template>

<script>
    import {Toast,Dialog} from 'vant';
    import Cookies from 'js-cookie';
    export default {
        name: "Sharerecord",
        data(){
            return{
                token:'',
                inviteList:[],
                noRecord:false
            }
        },
        mounted(){
            this.token = Cookies.get("token")
            this.$api.personInf.personShareRecord({openid:this.token}).then(res=>{
                if(res.code==0){
                    var data = res.data
                    var success = data.success;
                    if(success) {
                        this.inviteList = data.inviteList
                    }else{
                        Toast(data.msg)
                        this.noRecord = true
                    }
                }
            }).catch(err=>{
                console.log(err)
            })
        }
    }
</script>

<style scoped>
    .app_buyrecord_panel {
        font-size: 14px;
        text-align: center;
        margin-top: 0px;
    }

    .app_buyrecord_tab {
        line-height: 28px;
        overflow: hidden;
        width: 100%;
    }

    .app_buyrecord_tab .title {
        float: left;
        display: inline;
        overflow: hidden;
        background: #F3F3F3;
        font-size: 16px;
        font-weight: bold;
        color: #0b56a7;
        padding: 10px 0;
    }

    .app_buyrecord_tab .word {
        float: left;
        display: inline;
        overflow: hidden;
        background: #FFFFFF;
        padding: 5px 0;
        font-size: 14px;
        color: #2C2C2C;
        border-bottom: 1px solid #F3F3F3;
    }
    .cmw_noinvest{
        color: orangered;
        padding: 10px;
        text-align: center;
        font-size: 16px;
    }

</style>
